package com.qiaoba.api.system.entity.dto;

import com.qiaoba.common.base.validate.AddGroup;
import com.qiaoba.common.base.validate.EditGroup;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Set;

/**
 * 角色 DTO
 *
 * @author ailanyin
 * @date 2023-09-10 13:47:23
 */
@Data
public class SysRoleDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "角色ID")
    @NotNull(message = "角色ID不能为空", groups = {EditGroup.class})
    @Size(max = 20, message = "角色ID不能超过{max}个字符", groups = {EditGroup.class})
    private String roleId;

    @Schema(description = "角色名称")
    @NotBlank(message = "角色名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 30, message = "角色名称不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String roleName;

    @Schema(description = "角色标识")
    @NotBlank(message = "角色标识不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 100, message = "角色标识不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String roleKey;

    @Schema(description = "角色排序")
    @Min(value = 1, message = "角色排序最小{value}个字符", groups = {AddGroup.class, EditGroup.class})
    private Integer roleSort;

    @Schema(description = "数据范围（1：所有数据权限；2：自定义数据权限；3：本部门数据权限；4：本部门及以下数据权限；5：仅本人数据权限）")
    @Size(max = 1, message = "数据范围不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String dataScope;

    @Schema(description = "菜单树选择项是否关联显示（ 0：父子不互相关联显示 1：父子互相关联显示）")
    private Boolean menuCheckStrictly;

    @Schema(description = "部门树选择项是否关联显示（0：父子不互相关联显示 1：父子互相关联显示 ）")
    private Boolean deptCheckStrictly;

    @Schema(description = "角色状态（1正常 0停用）")
    @NotBlank(message = "角色状态不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 1, message = "角色状态不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String status;

    @Schema(description = "备注")
    @Size(max = 500, message = "备注不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String remark;

    @Schema(description = "菜单组")
    private Set<String> menuIds;

    @Schema(description = "部门组（数据权限）")
    private Set<String> deptIds;

}
